<?php
/**
 * Created by PhpStorm.
 * User: lihui
 * Date: 3/26/2021
 * Time: 16:36
 */
namespace app\common\model\coin;

use app\common\model\base\A3Mall;
use mall\basic\Users;
use think\facade\Db;

class CoinRuleCover extends A3Mall
{
    protected $autoWriteTimestamp = true;
    protected $name = "coin_rule_cover";

    protected $type = [
        "id"=>"string",
        "coin_rule_id"=>"integer",
        "overlap"=>"float",
        "callback"=>"float",
        "create_time"=>"integer",
        "update_time"=>"integer",
    ];

    public function getCreateTimeAttr($value){
        return date("Y-m-d H:i:s",$value);
    }

    public function getUpdateTimeAttr($value)
    {
        return date("Y-m-d H:i:s",$value);
    }

    protected function format($value)
    {
//        $value->status_name=$value->status_text;
//        $value->type_name= $value->type_name ?? $value->job_type->name ?? $value->jobType__name;
//        $value->publisher=$value->username;
//        $value->publish_time_text=$value->publish_time_text;
//        $value->exp_time_text=$value->exp_time_text;
        return $value;
    }

}
